<template>
	<div class="topContainer">
		<div class="Logo">医药行业文章发布系统</div>
		<div class="yonghuming">
			<el-button class="dlm"  icon="el-icon-s-tools" type="text"><span class="nn">欢迎管理员:{{adminName}}</span></el-button>
			<el-button class="dlmt" icon="el-icon-error" type="text" @click="exit"><span class="nn">退出登录</span></el-button>
		</div>
	</div>
</template>

<script>
export default {
	name: 'top',
	data() {
		return {
			adminName:'admin',
			userone:[],
		};
	},
	mounted:function(){
		this.query();//需要触发的函数
		// this.adminName=this.$route.query.IUserName;
	},
	methods: {
		exit(){
			this.$router.push({path:'/Login'});
		},
		query(){
			let that=this
			// that.expid = localStorage.getItem('expertId');
			this.$axios.post(
					'http://localhost:7070/api/Administration/CheckLoginSysUser',
					// that.$qs.stringify(obj)
					this.$qs.stringify({userName:that.adminName,}),
			).then(function (response) {
				console.log("------------1-------------------")
				console.log(response.data);
				// console.log(response.data[1]);
				that.userone = response.data;
				console.log("------------2-------------------")
				console.log(that.userone);
			})
		},
	}
};
</script>

<style >
.topContainer {
	display: flex;
	/*padding-left: 20px;*/
	margin-right: 80px;
	height: 50px;
	width: 1880px;
	background-color: #b3d4fc;

}
.Logo{
	position: absolute;
	/*left: 10px;*/
	text-align: left;
	font-size: 30px;
}
.yonghuming{
	position: absolute;
	right: 30px;
	margin-right: 100px;
}
.topContainer{
	text-align: left;
}
.nn{
	font-size: 20px;
}

</style>
